package main

import "fmt"

func main() {
	//iota 常量生成器,每隔一行自动加1
	//iota 赋值给常量使用
	const (
		a = iota
		b = iota
		c = iota
	)

	fmt.Printf("a : %d , b : %d , c : %d \n", a, b, c)

	//每遇到一次const iota 重置为 0

	const d = iota

	fmt.Printf("d : %d  \n", d)

	//可以只赋值一次
	const (
		a2 = iota
		b2
		c2
	)

	fmt.Printf("a2 : %d , b2 : %d , c3 : %d \n", a2, b2, c2)

	//同一行为0
	const (
		a3, b3, c3 = iota, iota, iota
	)

	fmt.Printf("a3 : %d , b3 : %d , c3 : %d \n", a3, b3, c3)
}
